Skip to content

feat(circuits): prove synchronized C7 plaintext on Minimum - #2526

Open
neogiacomo wants to merge 7 commits into
feat/2050-c6-minimumfrom
feat/2050-c7-minimum
Open

neogiacomo wants to merge 7 commits into
feat/2050-c6-minimumfrom
feat/2050-c7-minimum

Conversation

@neogiacomo

@neogiacomo neogiacomo commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Stacked slice of #2050, based on feat/2050-c6-minimum (20 changed files). Merge into main in order after prerequisite reviews; retarget as the stack lands.

Opens exactly the ordered C6 rows, adds c0 once, sums without a second Lagrange weighting, and binds all 50 plaintext coefficients.

Verification: Real native C4/C6/C7 integration; 17,265 C7 gates. Mixed valid shares on the same ciphertext rejected.

Compatibility and limits: disabled sync-insecure-64/minimum definition only. No deployed VK replacement, runtime activation, peer wire or persistent-state migration, or release-counter bump. Existing SS routes remain in place. Source rollback before activation requires no replay/reset. No secure-profile qualification or release authorization is implied.

Protocol review requested: see docs/architecture/threshold-decryption.md, docs/architecture/proof-statements.md, and docs/architecture/circuit-artifacts.md. Independent cryptographic review is pending.

Summary by CodeRabbit

  • New Features
    • Added support for synchronized plaintext aggregation, including validation of threshold decryption contributions and message values.
    • Added circuit configuration and public-input handling for the aggregation workflow.
  • Documentation
    • Updated architecture and witness documentation with Minimum C6 and C7 details and proof-statement requirements.

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
interfold-dashboard Ready Ready Preview Nov 20, 2026 9:46am UTC
interfold-docs Ready Ready Preview Nov 20, 2026 9:46am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request adds a synchronized C7 plaintext-aggregation circuit, its configuration and witness preparation, and public-signal validation. It also updates synchronized decryption tests to use configurable rosters and documents the C7 proof inputs and verification boundaries.

Changes: Synchronized C7 aggregation

Layer / File(s) Summary
C7 configuration and public signals
circuits/lib/src/configs/synchronized/sync_insecure_64.nr, crates/zk/config/src/circuit.rs, crates/zk/config/src/synchronized.rs, crates/zk/config/src/synchronized/public_signals.rs
The synchronized configuration defines C6 and C7 constants and public-input counts. Public-signal decoding checks the C6 rows, their ordered roster and shared commitments, and the encoded message fields.
Witness preparation and polynomial validation
crates/zk/witness/src/synchronized/*
The new witness preparation validates contributions and message bounds, then assembles C7 witness data. Shared polynomial helpers validate coefficients and ciphertext components; threshold-decryption preparation uses those helpers.
Aggregation circuit and executable
circuits/bin/synchronized/threshold/*, circuits/lib/src/core/synchronized/*, circuits/lib/src/core/threshold/decrypted_shares_aggregation.nr
The circuit validates designated C6 rows and shares, combines c0 with the shares, reconstructs and decodes plaintext coefficients, and checks them against the message. A new package entry point delegates to the circuit implementation.
End-to-end tests and architecture descriptions
crates/bfv/threshold/tests/synchronized_dkg.rs, crates/bfv/threshold/tests/synchronized_dkg/threshold_decryption.rs, crates/zk/witness/README.md, docs/architecture/*
Tests use supplied dealer rosters and cover C7 aggregation inputs and rejection cases. Documentation describes C7 inputs, aggregation steps, and proof-verification boundaries.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Possibly related issues

  • Issue 2050: The PR implements the synchronized C7 aggregation portion by combining ordered C6 rows, adding c0 once, and checking the plaintext; it does not complete the full issue.
  • Issue 2456: The PR contributes the synchronized C7 circuit component described in the milestone; it does not add runtime integration.
  • Issue 2461: The PR changes a synchronized profile and documents proof-verification boundaries, but does not complete the broader qualification work.
  • Issue 2460: The PR supplies C7 proof-side aggregation behavior that the runtime issue describes as a dependency; it does not implement runtime integration.
  • Issue 2462: The circuit and tests check set consistency and reject mixed contributions, matching the issue’s set-binding objective; replacement and recovery are not implemented.

Suggested reviewers: zahrajavar, ctrlc03

Merge Risk: Minimal · up to 89327

This change adds a disabled draft circuit for synchronized plaintext aggregation, along with supporting configuration, witness preparation, tests, and documentation. It does not change deployed behavior, and the review found no concrete defect. Independent cryptographic review is still pending, as the author notes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat(circuits): prove synchronized C7 plaintext on Minimum" matches the main change. The PR adds a Minimum-profile circuit (plaintext_aggregation and decrypted_shares_aggregation) that prov…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(circuits): prove synchronized C7 plaintext on Minimum" matches the main change. The PR adds a Minimum-profile circuit (plaintext_aggregation and decrypted_shares_aggregation) that proves synchronized C7 plaintext by opening ordered C6 rows, adding c0 once, and binding all 50 plaintext coefficients. The title is specific and concise, and it names the profile the change targets. Its scope is limited to the disabled sync-insecure-64/minimum definition, which the title does not need to state.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.1)

Clippy execution failed
Clippy (1.99.1) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between fc5a0f1 and 8932766.

Files selected for processing: 20

  • circuits/bin/synchronized/threshold/Nargo.toml
  • circuits/bin/synchronized/threshold/decrypted_shares_aggregation/Nargo.toml
  • circuits/bin/synchronized/threshold/decrypted_shares_aggregation/src/main.nr
  • circuits/lib/src/configs/synchronized/sync_insecure_64.nr
  • circuits/lib/src/core/synchronized/mod.nr
  • circuits/lib/src/core/synchronized/plaintext_aggregation.nr
  • circuits/lib/src/core/synchronized/threshold_decryption.nr
  • circuits/lib/src/core/threshold/decrypted_shares_aggregation.nr
  • crates/bfv/threshold/tests/synchronized_dkg.rs
  • crates/bfv/threshold/tests/synchronized_dkg/threshold_decryption.rs
  • crates/zk/config/src/circuit.rs
  • crates/zk/config/src/synchronized.rs
  • crates/zk/config/src/synchronized/public_signals.rs
  • crates/zk/witness/README.md
  • crates/zk/witness/src/synchronized/mod.rs
  • crates/zk/witness/src/synchronized/plaintext_aggregation.rs
  • crates/zk/witness/src/synchronized/polynomials.rs
  • crates/zk/witness/src/synchronized/threshold_decryption.rs
  • docs/architecture/circuit-artifacts.md
  • docs/architecture/proof-statements.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@neogiacomo

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@neogiacomo

Copy link
Copy Markdown
Contributor Author

@coderabbitai rate limit

@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Your plan includes PR reviews subject to rate limits. Reviews are available now.

@neogiacomo

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

This branch was successfully deployed

2 active deployments
Preview – interfold-dashboard — 8932766e Deployed Nov 20, 2026 by vercel[bot]
Preview – interfold-docs — 8932766e Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant